EFI: fix efi_arch_allocate_mmap_buffer() to return new size
authorRoy Franz <roy.franz@linaro.org>
Thu, 23 Oct 2014 08:23:43 +0000 (10:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 Oct 2014 08:23:43 +0000 (10:23 +0200)
commit932881d953476444ed934c94dbc098c0fefb4d77
tree82545e52a4f1bf7266c33100c3a28e49364c39c5
parent04dbb22e89c0e5f947e509d4728354923082264a
EFI: fix efi_arch_allocate_mmap_buffer() to return new size

efi_arch_allocate_mmap_buffer() allocates a buffer for the EFI memory map, and
for ARM it allocates a larger buffer than requested. This is done to account
for the increase in the map size that may occur when the allocation is made.
The previous code allocated a larger buffer, but did not adjust the size to
match.  This caused the later call to GetMemoryMap() to fail with a
BUFFER_TOO_SMALL error, since the original, smaller size was used.  This patch
changes the argument to efi_arch_allocate_mmap_buffer() to be a pointer to
UINTN, and the ARM version updates the size on a successful allocation.
The x86 version uses a different allocation method, so only the function
argument type is changed.
Also add decode of the BUFFER_TOO_SMALL error code to PrintErrMesg().

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com> [ARM]
Acked-by: Jan Beulich <jbeulich@suse.com> [non-ARM]
xen/arch/arm/efi/efi-boot.h
xen/arch/x86/efi/efi-boot.h
xen/common/efi/boot.c